Level pre-commit's ruff with the one this project declares - #7
Merged
Conversation
They had drifted two minor versions apart: the hook pinned v0.14.9 while the dev dependency is 0.16.6. A hook running an older linter than the project's own reports findings `uv run ruff` does not, and the symptom was `make check` failing on `scripts/sync_js_artifacts.py`, a file nobody had touched, for S310 on a URL whose scheme is a literal on the line above the call. Newer ruff reads that correctly; the older one could not. `ruff-format` is held to Python. From v0.15 it also formats Python inside Markdown fences, and letting the bump enable that would rewrite 46 published pages: it collapses the aligned trailing comments the examples use to explain themselves and rewraps calls that were wrapped for reading. Whether the site's examples should be machine-formatted is an editorial decision about the documentation, and not one a version bump should make on the way past.
Contributor
|
Docs preview for this PR is available at: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make checkfailed onscripts/sync_js_artifacts.pyfor S310, on a file nobody had touched.The cause is not the code. pre-commit pinned ruff v0.14.9 while this project's dev dependency is 0.16.6, so the hook ran a linter two minor versions behind the one
uv run ruffruns — and the two disagreed. The flagged line builds its URL from an f-string whosehttps://prefix is a literal directly above the call, with only a repo constant and the pinned docs level interpolated after it. The scheme cannot vary. Newer ruff reads that correctly and reports nothing; v0.14.9 could not.So the fix is the stale pin, not a
noqaon correct code.Why
ruff-formatis held to PythonBumping the pin alone reformats 46 published documentation pages. From v0.15
ruff-formatalso formats Python inside Markdown fences, which collapses the aligned trailing comments the examples use to explain themselves:and rewraps calls that were wrapped for reading. Whether the site's examples should be machine-formatted is an editorial decision about the documentation. It might well be the right one — but it should be made deliberately, not as a side effect of catching a linter up.
types_or: [python, pyi]holds the hook to exactly what it formatted before, so this change is the S310 fix and nothing else.Verified
uv run pre-commit run --all-files: every hook passes, and the diff is one file.uv run pyright: 22 errors onmainand 22 on this branch, identical. Those are pre-existing and separate — mostlyBatchResultnot being iterable and asave_idfimport in the tutorial snippet — and they keepmake checkred for a reason this PR does not touch and does not claim to fix.